package cn.tedu.baking.mapper;

import cn.tedu.baking.pojo.entity.Content;
import cn.tedu.baking.pojo.vo.ContentDetailVO;
import cn.tedu.baking.pojo.vo.ContentIndexVO;
import cn.tedu.baking.pojo.vo.ContentVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Author：毕龙
 * Date: 2024/8/15 17:03
 */
public interface IContentMapper {
    int insert(Content content);

    List<ContentVO> getContentsByCreateBy(@Param("createBy") Integer createBy,
                                          @Param("type") Integer type);

    int deleteContentsById(Integer id);

    ContentVO getContentsById(Integer id);

    int updateContentById(Content content);

    List<ContentIndexVO> getContentsByTypeAndCategoryId(@Param("type") Integer type, @Param("categoryId") Integer categoryId);
    List<ContentIndexVO> getContentsByType( Integer type);

    List<ContentIndexVO> getContentslikeTitle(String title);

    ContentDetailVO getContentsByContentId(Integer id);

    int updateViewCountById(Integer id);

    List<ContentIndexVO> getContentsByCreateByAndContentId(@Param("createBy")Integer createBy, @Param("id")Integer id);
}
